package com.yonyou.cyxdms.sysAuth.service.dto;

import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * 菜单信息
 *
 * @author quankk
 * @since 2019-07-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class MenuDTO extends DMSBaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 菜单ID
     */
    private Long menuId;

    /**
     * 排序
     */
    private Integer rank;

    /**
     * 菜单名
     */
    private String menuName;

    /**
     * 菜单URL
     */
    private String menuUrl;

    /**
     * 菜单图标
     */
    private String menuIcon;

    /**
     * 菜单描述
     */
    private String menuDesc;

    /**
     * 菜单英文名
     */
    private String menuNameEn;

    /**
     * 父级菜单ID
     */
    private Integer parentId;

    /**
     * 菜单状态(10011001有效,10011002无效)
     */
    private Integer menuStatus;

    /**
     * 菜单类型(OEM、DEALER)
     */
    private Integer menuType;

    /**
     * 菜单分类(PC、APP)
     */
    private Integer menuCategory;

    private Integer dataType;

    private Boolean isDeleted;

    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param poClass dto 需要转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param po 需要转换的对象
     * @author quankk
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "menuId");
    }

}
